import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
import {useStore} from "vuex";
import {nextTick} from "vue";
import qs from "qs";
import Cookies from "js-cookie";
import http from "./request.js";

export const message = ElMessage
export const messageBox = ElMessageBox

export const notice = ElNotification

export const refresh = (store) => {
    store.commit('setContentIsNeedRefresh', true)
    nextTick(() => {
        store.commit('setContentIsNeedRefresh')
    })
}


// 导出
export const exportHandle = (url='', dataForm) => {
    const params = qs.stringify({
        'token': Cookies.get('token'),
        ...dataForm
    });
    window.location.href = `${window.SITE_CONFIG['apiURL']}${url}/export?${params}`
}
